$(function () {
    window['moment-range'].extendMoment(moment);
    //大数据时间显示
    $(".dataStatistics .timeRun").text(moment().format('YYYY-MM-DD HH:mm:ss'));
    setInterval(function () {
        $(".dataStatistics .timeRun").text(moment().format('YYYY-MM-DD HH:mm:ss'));
    }, 1000);

    // 点击数据统计加载数据
    $('.bigData-trigger').on('click',function(){
        threeColorDataList();
        // 大数据七日报警渲染
        sevenAlarmSumDataRander();
        dataGuanZhuTime();
        policeSource();
        policeReason();
        responseSpeed();
    });
    // threeColorDataList();
    // // 大数据七日报警渲染
    // sevenAlarmSumDataRander();
    // dataGuanZhuTime();
    // policeSource();
    // policeReason();
    // responseSpeed();
    // 大数据中三色预警场所列表
    function threeColorDataList(){
      $.ajax({
        url:'/threeColor/getRectifyInfo?size=10000&page=0&levelisk=1',
        success:function (res){
          $('.listBox .earlyWarningColor1 .table').html('');
          var data = res.data.content;
          for(var i=0;i<data.length;i++){
            $('#bigDataModal .listBox .earlyWarningColor1 .table').append('<p>'+(+i+1)+'.'+data[i].tcw.address+'</p>');
          }
        }
      });
      $.ajax({
        url:'/threeColor/getRectifyInfo?size=10000&page=0&levelisk=2',
        success:function (res){
          $('.listBox .earlyWarningColor2 .table').html('');
          var data = res.data.content;
          for(var i=0;i<data.length;i++){
            $('#bigDataModal .listBox .earlyWarningColor2 .table').append('<p>'+(+i+1)+'.'+data[i].tcw.address+'</p>');
          }
        }
      });
      $.ajax({
        url:'/threeColor/getRectifyInfo?size=10000&page=0&levelisk=3',
        success:function (res){
          $('.listBox .earlyWarningColor3 .table').html('');
          var data = res.data.content;
          for(var i=0;i<data.length;i++){
            $('#bigDataModal .listBox .earlyWarningColor3 .table').append('<p>'+(+i+1)+'.'+data[i].tcw.address+'</p>');
          }
        }
      });
    }
    //点击三色预警切换
    // 三色预警点击较大火险场所
    $(".dataStatistics .item1").on('click', function () {
        $(".dataStatistics .list0").hide();
        $(".dataStatistics .list2").hide();
        $(".dataStatistics .list1").show();
        $(".dataStatistics .listBox").css('background', 'url(/public/images/highDanger.png) no-repeat');
        /* $(this).siblings().hide();
        $(this).parent().find(".earlyWarningColor").show(); */
    });
    // 三色预警点击高危火险场所
    $(".dataStatistics .item2").on('click', function () {
        $(".dataStatistics .list0").hide();
        $(".dataStatistics .list1").hide();
        $(".dataStatistics .list2").show();
        $(".dataStatistics .listBox").css('background', 'url(/public/images/normalDanger.png) no-repeat');
        /* $(this).siblings().hide();
        $(this).parent().find(".earlyWarningColor").show(); */
    });
    // 三色预警点击一般火险场所
    $(".dataStatistics .item0").on('click', function () {
        $(".dataStatistics .list0").show();
        $(".dataStatistics .list1").hide();
        $(".dataStatistics .list2").hide();
        $(".dataStatistics .listBox").css('background', 'url(/public/images/middleDanger.png) no-repeat');
        /* $(this).siblings().hide();
        $(this).parent().find(".earlyWarningColor").show(); */
    });  

    // 七日重点关注对象 柱形图    
    function dataGuanZhuTime() {
        var statisticsFocusNum = [];
        var statisticsFocusAdd = [];
        var statisticsFocusAdd1 = [];
        var beginTime = moment().add('days', -6).format('YYYY-MM-DD') + " 00:00:00";
        console.log(beginTime);
        var endTime = moment().add('days', 0).format('YYYY-MM-DD') + " 23:59:59";
        console.log(endTime);
        var data = [];
        $.ajax({
            // url:"/alarm/data/device/count?beginTime=2018-05-28%2016:54:55&endTime=2019-09-28%2016:54:55&alarmTypeCode=1&deviceTypeId=1",
            url: "/alarm/data/device/count?beginTime="+beginTime+"&endTime="+endTime+"&alarmTypeCode=1&deviceTypeId=1",
            type: 'GET',
            async: false, // 同步执行
            success: function (result) {
                console.log(result);
                if (result.status == 200) {
                    for (var i = 0; i < result.data.length; i++) {
                        // console.log(result.data);
                        data = result.data;
                        console.log(data);
                        for(var j = 0; j < (7 - data.length); j++) {                            
                            data.push(["", ""]);
                            console.log(data);
                        }   
                    }                 
                }
                var dataValue = [];
                for (var i = 0; i < data.length; i++) {
                    dataValue.push(data[i][1]);
                }
                console.log(dataValue);
                // 获取最大值
                var maxInNumbers = Math.max.apply(Math, dataValue);
                maxInNumbers = maxInNumbers + 2;
                console.log(maxInNumbers);        
                // 初始化 实例
                var dataGuanZhu = echarts.init(document.getElementById("dataGuanZhu"));
                var title = '重点对象';
                var option = {
                        //  backgroundColor: '#25499F',
                        baseOption: {
                        animationDurationUpdate: 1000,
                        animationEasingUpdate: 'quinticInOut',
                        legend: {
                            x: 'left',
                            orient: 'horizontal',
                        },
                        timeline: {
                            axisType: 'category',
                            orient: 'vertical',
                            autoPlay: true,
                                //  inverse: true,
                                playInterval: 5000,
                                left: null,
                                right: 30,
                                top: 330,
                                bottom: 100,
                                width: 40,
                                height: null,
                                label: {
                                normal: {
                                    // show: true,
                                    interval: 0,
                                    textStyle: {
                                        fontSize: 12
                                    }
                                },
        
                                },
                                symbol: 'none',
                                lineStyle: {
                                    color: '#ccc',
                                    show: false
                                },
                                checkpointStyle: {
                                    symbol: 'none',
                                    color: '#bbb',
                                    borderColor: '#777',
                                    show: false,
                                    borderWidth: 1
                                },
                                controlStyle: {
                                    showNextBtn: false,
                                    showPrevBtn: false,
                                normal: {
                                    color: '#666',
                                    show: false,
                                    borderColor: '#666'
                                },
                                emphasis: {
                                    color: '#aaa',
                                    borderColor: '#aaa'
                                }
                                },
                        },
                        title: [{
                            left: 'left',
                            top: '10%',
                            textStyle: {
                                fontSize: 16,
                                fontWeight: "normal",
                                color: '#fff'
                            }
                        },
                        ],
                        grid: {
                            left: '3%',
                            right: '4%',
                            bottom: '3%',
                            containLabel: true
                        },
                        xAxis: {
                            axisLabel: {
                                // 横坐标字体倾斜
                                interval: 0,
                                rotate: 40,
                                // show: false,
                                textStyle: {
                                    color: '#fff',
                                    fontSize: 10
                                },
                                nameTextStyle: {
                                    fontSize: 10,
                                    fontWeight: 200
                                }
                            },
                            nameTextStyle: {
                                fontSize: 10
                            }
                        },
                        yAxis : [{
                          type : 'value',                          
                          minInterval : 1,                          
                          axisLabel : {                          
                            formatter :  '{value}'                          
                          },                          
                          boundaryGap : [ 0, 0.1 ],                          
                          } ],
                        series: [
                            {
                                id: 'bar',
                                type: 'bar',
                                tooltip: {
                                    trigger: 'item',
                                    formatter: "{a} <br/>{b} : {c} ({d}%)",
                                    textStyle: {
                                        fontSize: 12,
                                        fontWeight:100
                                    }
                                },
                                label: {
                                    normal: {
                                        show: true,
                                        position: 'top',
                                        textStyle: {
                                            color: '#fff',
                                            fontSize: 10,
                                            fontWeight: 200                        
                                        }
                                    }
                                },
                                barWidth: '18px',//柱图宽度
                                data: dataValue
                            },
                        ]
                        },
                        options: []
                }
                option.options.push({
                    title: {
                    text: title
                    },
                    legend: {
                        orient: 'horizontal',
                        x: 'left'
                    },
                    xAxis: [
                    {
                        type: 'category',
                        axisLabel: {
                            // 横坐标字体倾斜
                            interval: 0,
                            rotate: 40,
                            position: 'left',
                            formatter:function(params) {
                                var newParamsName = "";
                                var paramsNameNumber = params.length;
                                var provideNumber = 5;  //一行显示几个字
                                var rowNumber = Math.ceil(paramsNameNumber / provideNumber);
                                if (paramsNameNumber > provideNumber) {
                                    for (var p = 0; p < rowNumber; p++) {
                                        var tempStr = "";
                                        var start = p * provideNumber;
                                        var end = start + provideNumber;
                                        if (p == rowNumber - 1) {
                                            tempStr = params.substring(start, paramsNameNumber);
                                        } else {
                                            tempStr = params.substring(start, end) + "\n";
                                        }
                                        newParamsName += tempStr;
                                    }
                            
                                } else {
                                    newParamsName = params;
                                }
                                return newParamsName
                            },
                            // 让横坐标的 数据文字 不显示
                            // show: false,
                            textStyle: {
                                color: '#fff',
                                fontSize: 10  
                            }
                        },
                        nameTextStyle: {
                            fontSize: 10
                        },
                        axisLine: {
                            lineStyle: {
                            type: 'solid',
                            color: '#fff',//左边线的颜色
                            width: '1'//坐标线的宽度
                            },
                            nameTextStyle: {
                                fontSize: 10
                            }
                        },
                        //do------------------------------------------------------------
                        data: data.map(function (ele) {
                            return ele[0];
                        }),
                        // data: data.map(function (ele) {
                        //     return ele[0];
                        // }).reverse(),
                    }
                    ],
                    yAxis: {      
                        minInterval : 1,          
                        axisLabel : {                        
                            formatter :  '{value}'                        
                        },                        
                        boundaryGap : [ 0, 0.1 ],
                        type: 'value',
                        axisTick: {
                            alignWithLabel: true
                        },
                        axisLine: {
                            lineStyle: {
                                type: 'solid',
                                color: '#fff',//左边线的颜色
                                width: '1'//坐标线的宽度
                            }
                        },
                        max: maxInNumbers,     
                        minInterval : 1,    
                    },
                    series: [
                    {
                        id: 'bar',
                        label: {
                            normal: {
                                position: 'top',
                                // formatter: '{b} : {c}',                                                              
                                formatter: '{c}',   
                                // 倾斜                           
                                // interval: 0,
                                // rotate: 40,
                                textStyle: {
                                    fontSize: 12  
                                }
                            },
                        },
                        data: data.map(function (ele) {
                            console.log(ele[1])
                            return ele[1]
                        })
                        // data: data.map(function (ele) {
                        //     console.log(ele[1])
                        //     return ele[1]
                        // }).sort(function (a, b) {
                        //     return a > b
                        // })
                    },
                    ]
                })
                // 使用制定的配置项和数据显示图表
                dataGuanZhu.setOption(option);
            }
        });      
    } 
    // 响应速度 月份字样
    var dataStatisticsSpeedTime = new Date();
    dataStatisticsSpeedTime = dataStatisticsSpeedTime.getMonth() + 1;
    $(".dataStatisticsSpeedTime").text(dataStatisticsSpeedTime + "月");

    // 报警来源
    function policeSource(){
        var statisticsFocusNum = [];
        var statisticsFocusAdd = [];
        var statisticsFocusAdd1 = [];
        var beginTime = moment().add('days', -6).format('YYYY-MM-DD') + " 00:00:00";
        console.log(beginTime);
        var endTime = moment().add('days', 0).format('YYYY-MM-DD') + " 23:59:59";
        console.log(endTime);
        var data = [];
        $.ajax({
            // http://localhost:9092/alarm/data/org/device/fixcount?beginTime=2018-09-15%2000:00:00&endTime=2018-09-21%2023:59:59&alarmTypeCode=1&deviceTypeId=1
            url: "/alarm/data/org/device/fixcount?beginTime="+beginTime+"&endTime="+endTime+"&alarmTypeCode=1&deviceTypeId=1",
            type: 'GET',
            async: false, // 同步执行
            success: function (result) {    
                console.log(result);  
                console.log(result.data);   
                data = result.data;   
                for(var i = 0; i < data.length; i++) {
                    console.log(data[i].name);
                    var n1 = 0;
                    var index;
                    // 将name为null 的值添加到公司的值中
                    if(data[i].name == 'null') {
                        // console.log(data[i].value);
                        n1 = data[i].value;
                        index = i;
                        data.splice(index, 1);
                    }
                    if(data[i].name == '公司') {
                        console.log(data[i].value);
                        data[i].value = data[i].value + n1;
                        console.log(data[i].value);
                    }
                    console.log(index);
                    console.log(data);
                }               
                var dataName = [];
                for(var i = 0; i < data.length; i++) {
                    dataName.push(data[i].name);
                } 
                console.log(dataName);
                // 初始化 实例
                var policeSource = echarts.init(document.getElementById("policeSource"));
                option = {
                    color:['#2b80b9','#169d96','#ef6b56','#905352'],
                    title : {
                        text: '报警来源',
                        x:'center',
                        textStyle: {
                            fontSize: 16,
                            fontWeight: "normal",
                            color: '#fff'
                        }
                    },
                    tooltip : {
                        trigger: 'item',
                        formatter: "{a} <br/>{b}: {c}"
                    },
                    legend: {
                        icon: 'circle',
                        orient: 'vertical',
                        left: 10,
                        top: '20px',
                        itemWidth: 10,
                        itemHeight: 10,
                        textStyle: {
                            fontSize: 10,
                            fontWeight: "normal",
                            color: '#fff'
                        },
                        data: dataName
                    },
                    series : [
                        {
                            name: '报警来源',
                            type: 'pie',
                            radius : '55%',
                            center: ['55%', '52%'],
                            // data:[
                            //     {value: 30, name:'出租房30%'},
                            //     {value: 29, name:'居民房29%'},
                            //     {value: 19, name:'公共19%'},
                            //     {value: 22, name:'饭店22%'},
                    
                            // ],
                            data: data,
                            itemStyle: {
                                emphasis: {
                                    shadowBlur: 10,
                                    shadowOffsetX: 0,
                                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                                }
                            }
                        }
                    ]
                };       
                // 使用制定的配置项和数据显示图表
                policeSource.setOption(option);
            }
        });   
    }

    // 报警原因
    function policeReason(){
        var statisticsFocusNum = [];
        var statisticsFocusAdd = [];
        var statisticsFocusAdd1 = [];
        var beginTime = moment().add('days', -6).format('YYYY-MM-DD') + " 00:00:00";
        console.log(beginTime);
        var endTime = moment().add('days', 0).format('YYYY-MM-DD') + " 23:59:59";
        console.log(endTime);
        var data = [];
        $.ajax({
            // http://localhost:9092/alarm/data/org/device/alarmReason?beginTime=2018-09-15%2000:00:00&endTime=2018-09-29%2023:59:59&alarmTypeCode=1&deviceTypeId=1
            url: "/alarm/data/org/device/alarmReason?beginTime="+beginTime+"&endTime="+endTime+"&alarmTypeCode=1&deviceTypeId=1",
            type: 'GET',
            async: false, // 同步执行
            success: function (result) {    
                console.log(result);  
                console.log(result.data);   
                data = result.data;  
                var n1 = 0; 
                var n2 = 0;
                for(var i = 0; i < data.length; i++) {
                    console.log(data[i].name);                
                    var index;
                    var index2;
                    // 将name为null 的值添加到炊烟的值中
                    if(!data[i].name) {
                        console.log(data[i].value);
                        n2 = data[i].value;
                        index2 = i;
                        console.log(data);
                        data.splice(index2, 1);
                        console.log(data);
                        // i--;
                    }
                    if(data[i].name == 'null') {
                        console.log(data[i].value);
                        n1 = data[i].value;
                        index = i;
                        console.log(data);
                        data.splice(index, 1);
                        // i--;
                        console.log(data);
                    }                   
                    if(data[i].name == '炊烟') {
                        console.log(data[i].value);
                        if(n1) {
                            data[i].value = data[i].value + n1;
                        }
                        if(n2) {
                            data[i].value = data[i].value + n2;
                        }
                        console.log(data[i].value);
                    }
                    console.log(index);
                    console.log(data);
                }    
                var dataName = [];
                for(var i = 0; i < data.length; i++) {
                    dataName.push(data[i].name);
                } 
                console.log(dataName);
                console.log(data);
                // 初始化 实例
                var policeReason = echarts.init(document.getElementById("policeReason"));
                option = {
                    color:['#2d96b3','#ffca5a','#fe912a','#71ffd2','#df2938'],
                    title : {
                        text: '报警原因',
                        x:'center',
                        textStyle: {
                            fontSize: 16,
                            fontWeight: "normal",
                            color: '#fff'
                        }
                    },
                    tooltip : {
                        trigger: 'item',
                        formatter: "{a} <br/>{b}: {c}"
                    },
                    legend: {
                        icon: 'circle',
                        orient: 'vertical',
                        left: 10,
                        top: '20px',
                        itemWidth: 10,
                        itemHeight: 10,
                        textStyle: {
                            fontSize: 10,
                            fontWeight: "normal",
                            color: '#fff'
                        },
                        data: dataName
                    },
                    series : [
                        {
                            name: '报警原因',
                            type: 'pie',
                            radius : '55%',
                            center: ['55%', '52%'],
                            data: data,
                            // data:[
                            //     {value: 57, name:'炊烟56%'},                        
                            //     {value: 26, name:'吸烟26%'},
                            //     {value: 5, name:'其他5%'},
                            //     {value: 3, name:'火警3%'},
                            //     {value: 10, name:'粉尘10%'},                    
                            // ],
                            itemStyle: {
                                emphasis: {
                                    shadowBlur: 10,
                                    shadowOffsetX: 0,
                                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                                }
                            }
                        }
                    ]
                };
                // 使用制定的配置项和数据显示图表
                policeReason.setOption(option);
            }
        });         
    }
    // 七日报警统计 柱形图 响应速度
    function responseSpeed() {
        // 根据不同月份 获取响应天数
        // dataStatisticsSpeedTime
        // 获取当前年份 判断是否为闰年
        var dataStatisticsSpeedTimeYear = new Date();
        var days;
        days = dataStatisticsSpeedTimeYear.getDate();
        console.log(days);

        var beginTime = moment().format('YYYY-MM') + "-01 00:00:00";
        console.log(beginTime);
        var endTime = moment().add('days', 0).format('YYYY-MM-DD') + " 23:59:59";
        console.log(endTime);
        var data = [];
        $.ajax({
            // http://localhost:9092/alarm/data/respond/count?beginTime=2018-09-15%2000:00:00&endTime=2018-09-21%2023:59:59&alarmTypeCode=1&deviceTypeId=1
            url: "/alarm/data/respond/count?beginTime="+beginTime+"&endTime="+endTime+"&alarmTypeCode=1&deviceTypeId=1",
            type: 'GET',
            async: false, // 同步执行
            success: function (result) {    
                console.log(result.data);     // {1: 1, 2: 0, 0.5: 489, 1.5: 0, 2.5: 0}         
                // $.each(result.data, function(i, val) {  
                //     data.push(val); 
                // });      
                // console.log(data);
                // 换位置
                // var tem = ''; 
                // tem = data[2];
                // data[2] = data[1];
                // data[1] = data[0];
                // data[0] = tem;
                // console.log(data);  

                var data = [];
                data.push(result.data["0.5"]);
                data.push(result.data["1"]);
                data.push(result.data["1.5"]);
                data.push(result.data["2"]);
                data.push(result.data["2.5"]);
                data.push(result.data["3"]);
                console.log(data);
                // 获取大于3分钟的总数值
                // $.each(result.data, function(i, val) {   
                //     if(i > 3) {
                //         data.push(val);
                //     }               
                // });
                console.log(data);
                
                
                var dataValue = [];
                $.each(data, function(i, val) {  
                    dataValue.push(val);
                }); 
                console.log(dataValue);
                // 获取最大值
                var maxInNumbers = Math.max.apply(Math, dataValue);
                maxInNumbers = maxInNumbers + 2;
                console.log(maxInNumbers);        
                // 初始化 实例
                var responseSpeed = echarts.init(document.getElementById("responseSpeed"));         
                option = {
                    color:  ["#fdff4a"],
                    title: [{
                        text: "响应速度",
                        left: 'left',
                        top: '0%',
                        textStyle: {
                            fontSize: 16,
                            fontWeight: "normal",
                            color: '#fff'
                        }
                    }],
                    tooltip: {
                        show: false
                    },
                    grid: {
                        left: '3%',
                        right: '12%',
                        bottom: '10%',
                        containLabel: true
                    },
                    xAxis : [
                        {
                            type : 'category',
                            name: '分钟',
                            data : [0.5, 1 ,1.5 ,2 ,2.5, 3],
                            axisTick: {
                                alignWithLabel: true
                            },
                            axisLine: {
                                lineStyle: {
                                type: 'solid',
                                color: '#fff',//左边线的颜色
                                width: '1'//坐标线的宽度
                                },
                                nameTextStyle: {
                                    fontSize: 10
                                }
                            },
                        }
                    ],
                    yAxis : [
                        {
                            type : 'value',
                            name: '数量',
                            axisLine: {
                                lineStyle: {
                                    type: 'solid',
                                    color: '#fff',//左边线的颜色
                                    width: '1' //坐标线的宽度
                                }
                            },
                            // max: maxInNumbers,     
                            minInterval : 1, 
                            data: data 
                            // data: data.map(function (ele) {
                            //     return ele[0];
                            // }).reverse(),
                        }
                    ],
                    series : [
                        {
                            type:'bar',
                            barWidth: '18px',
                            label: {
                                show: true,
                                normal: {
                                    show: true,
                                    position: 'top',                                                             
                                    formatter: '{c}',   
                                    textStyle: {
                                        color: '#fff',
                                        fontSize: 10,
                                        fontWeight: 200  
                                    }
                                },
                            },
                            data: data
                            
                        }
                    ]
                };
                // 使用制定的配置项和数据显示图表
                responseSpeed.setOption(option);
            }
        });      
    } 
});
//  大数据	七日报警渲染
function sevenAlarmSumDataRander() {
    var alarmDateArrX = [];
    var alarmDateArrY = [];
    var beginTime = moment().add('days', -6).format('YYYY-MM-DD') + " 00:00:00";
    var endTime = moment().add('days', 0).format('YYYY-MM-DD') + " 23:59:59";
    var sevenAlarmCanvas = echarts.init(document.getElementById("statisticsCanvas"));
    var sevenAlarmCanvasoption;
    var start = moment().add('days', -6).format('YYYY-MM-DD');
    var end = moment().add('days', 0).format('YYYY-MM-DD');
    sevenAlarmSumData(alarmDateArrX, alarmDateArrY, start, end, beginTime, endTime, sevenAlarmCanvas, sevenAlarmCanvasoption);
}
// 获取大数据七日报警数据
function sevenAlarmSumData(alarmDateArrX, alarmDateArrY, start, end, beginTime, endTime, sevenAlarmCanvas, sevenAlarmCanvasoption) {
    var ret = getAlarmDeviceCount({
        beginTime,
        endTime,
        alarmTypeCode: '001',
        deviceTypeId: '001'
    });
    ret.then(function (data) {
        console.log(data)
        for (var i = 0; i < data.data.length; i++) {
            alarmDateArrX.push(data.data[i][0])
            alarmDateArrY.push(data.data[i][1])
        }
        console.log(alarmDateArrX, alarmDateArrY)
        var r1 = moment.range(start, end);
        var dataval = Array.from(r1.by('days')).map(m => m.format('YYYY-MM-DD'));
        for (var i = 0; i < dataval.length; i++) {
            if (dataval[i] != alarmDateArrX[i]) {
                alarmDateArrX.splice(i, 0, dataval[i]);
                alarmDateArrY.splice(i, 0, '0');
            }
        }
        for (var i = 0; i < dataval.length; i++) {
            alarmDateArrX[i] = alarmDateArrX[i].substr(8, 2) + '日';
        }
        sevenAlarmCanvasFunc(alarmDateArrX, alarmDateArrY, sevenAlarmCanvas, sevenAlarmCanvasoption);
    }).catch(function (err) {
        console.log(err)
    });
}

//七日报警图表封装
function sevenAlarmCanvasFunc(alarmDateArrX, alarmDateArrY, sevenAlarmCanvas, sevenAlarmCanvasoption) {
    sevenAlarmCanvasoption = {
        color: ['#3398DB'],
        title: {
            //text: '七日内的报警统计',
            textStyle: {
                fontWeight: 'normal',
                color: '#fff'
            },
        },
        tooltip: {},
        legend: {
            data: ['报警数量'],
            x: "right",
            padding: 10,
            textStyle: {
                fontWeight: 'normal',
                color: '#fff'
            },
            selectedMode: false, //禁止点击
        },
        xAxis: {
            data: alarmDateArrX,
            boundaryGap: false,
            textStyle: {
                fontWeight: 'normal',
                color: '#fff'
            },
            axisLine: {
                lineStyle: {
                    color: '#fff',
                    width: 1
                },
            },
        },
        yAxis: [{
            type: 'value',
            axisLine: {
                lineStyle: {
                    color: '#fff'
                }
            },
            textStyle: {
                fontWeight: 'normal',
                color: '#fff'
            },
            axisLabel: {
                formatter: '{value} 次'
            },
            minInterval : 1,
        
        axisLabel : {
        
        formatter :  '{value}'
        
        },
        
        boundaryGap : [ 0, 0.1 ],
        }],
        series: [

            {
                name: '报警数量',
                type: 'line',
                //	                   stack: '总量',
                symbolSize: 4,
                smooth: false, //关键点，为true是不支持虚线的，实线就用true
                symbolSize: 8, //拐点大小
                symbol: 'circle', //拐点样式
                color: '#e55454',
                barWidth: 28,
                itemStyle: {
                    normal: {
                        lineStyle: {
                            color: '#e55454',
                            width: 2,
                            type: 'solid' //'dotted'虚线 'solid'实线
                        }
                    }
                },
                //data: alarmDateArr,
                data: alarmDateArrY,
            },
        ],

        grid: {
            left: '10',
            right: '15',
            bottom: '10',
            top: '40',
            containLabel: true
        },
    };
    sevenAlarmCanvas.setOption(sevenAlarmCanvasoption);
}


